package com.example.newdemo.activity.activity;

import androidx.appcompat.app.AppCompatActivity;

import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.os.Looper;
import android.util.Log;
import android.view.View;
import android.widget.Button;

import com.example.newdemo.R;

public class SecondActivity extends AppCompatActivity {
    Button openHomeActivityButton;
    Button openSecondActivityButton;
    Button openThirdActivityButton;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_second);

        openHomeActivityButton=findViewById(R.id.openHomeActivity);
        openSecondActivityButton=findViewById(R.id.openSecondActivity);
        openThirdActivityButton=findViewById(R.id.openThirdActivity);
        openHomeActivityButton.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent intent = new Intent(SecondActivity.this, HomeActivity.class);
                startActivity(intent);
            }
        });
        openSecondActivityButton.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent intent = new Intent(SecondActivity.this, SecondActivity.class);
                startActivity(intent);
            }
        });
        openThirdActivityButton.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent intent = new Intent(SecondActivity.this, ThirdActivity.class);
                startActivity(intent);
            }
        });
        Log.e("test","SecondActivity活动被建立"+ Thread.currentThread()+"，在栈："+getTaskId());
    }

    @Override
    protected void onPause() {
        super.onPause();
    }

    @Override
    protected void onDestroy() {

        super.onDestroy();
        Log.e("test","SecondActivity活动被销毁"+"，在栈："+getTaskId());
    }
}